<template>
	<view class="box2">
		<view class="box2_cen" @click="handleSearch">
			<view class="box2_cen_left">
				<image src="/static/image/serachIcon.png" mode=""></image>
			</view>
			<view class="box2_cen_right">
				<view v-if="waitList.length>1" class="box2_cen_right_like">
					<text v-for="(item,index) in waitList" :key="index">
						{{item.text}}
					</text>
					<text>
						{{waitList[0].text}}
					</text>
				</view>
				<view v-else-if="waitList.length==1" class="box2_cen_right_oneData">
					<text>{{waitList[0].text}}</text>
				</view>
				<view v-else class="box2_cen_right_noneData">
					<text>暂无最新内容</text>
				</view>
			</view>

		</view>
		<view class="box2_notify">
			<image src="/static/image/homeImage/notify.png" mode=""></image>
			<text>小游戏</text>
		</view>
	</view>
</template>

<script>
	export default {
		name: "notify",
		data() {
			return {
				waitList: [{
					text: "封我顶级账号然后游戏停服"
				}, {
					text: "召唤三百圣人吓懵圣地"
				}, {
					text: "穿书第一剑，先斩猪队友"
				}]
			};
		},
		methods: {
			handle() {
				console.log("去搜索页")
			},
			handleSearch(){
				uni.navigateTo({
					url:"/pages/searchNovel/searchNovel"
				})
			}
		}
	}
</script>

<style lang="scss" scoped>
	.box2 {
		padding: 0 30rpx;
		box-sizing: border-box;
		height: 100rpx;
		width: 100%;
		display: flex;
		justify-content: flex-start;
		align-items: center;
		&_cen {
			width: calc(100% - 100rpx);
			border-radius: 15rpx;
			height: 80rpx;
			background-color: #fff;
			display: flex;
			color:#000;
			align-items: center;
			position: relative;
			overflow: hidden;

			&_left {
				width: 80rpx;
				height: 80rpx;
				display: flex;
				justify-content: center;
				align-items: center;
				image {
					width: 30rpx;
					height: 30rpx;
				}
			}

			&_right {
				width: calc(100% - 80rpx);
				height: 80rpx;
				position: relative;
				&_oneData {
					width: 100%;
					height: 80rpx;
					line-height: 80rpx;
					text-align: center;
				}

				&_noneData {
					width: 100%;
					height: 80rpx;
					line-height: 80rpx;
					text-align: center;
				}

				&_like {
					width: 100%;
					display: flex;
					flex-direction: column;
					position: absolute;
					top: 0rpx;
					left: 0rpx;
					animation: player 8s infinite;
			

					text {
						height: 100%;
						height: 80rpx;
						line-height: 80rpx;
						white-space: nowrap;
						width: 100%;
						overflow: hidden;
						box-sizing: border-box;
						text-overflow: ellipsis;
					}
				}

				@keyframes player {
					0% {
						transform: translateY(0rpx);
					}

					33% {
						transform: translateY(-80rpx);
					}

					66% {
						transform: translateY(-160rpx);
					}

					100% {
						transform: translateY(-240rpx);
					}
				}
			}

		}

		&_notify {
			width: 100rpx;
			height: 100%;
			display: flex;
			flex-direction: column;
			justify-content: center;
			align-items: center;

			text {
				font-size: 20rpx;
			}

			image {
				width: 40rpx;
				height: 40rpx;
			}
		}
	}
</style>